const video = {
    source: 'https://s3-ap-northeast-1.amazonaws.com/sinyademo/How+to+Kickflip.mp4',
    metadata: {
        title: 'Title for Sample Video',
        subtitle: 'Secondary Title for Sample Video'
    }
};

const TrickTeachingIntent = {
    canHandle(handlerInput) {
        return handlerInput.requestEnvelope.request.type === 'IntentRequest'
            && handlerInput.requestEnvelope.request.intent.name === 'TrickTeachingIntent';
    },
    handle(handlerInput) {
        var intent = handlerInput.requestEnvelope.request.intent;
        const speechText = 'This is video of how to ' + intent.slots.teaching.value;

        return handlerInput.responseBuilder
            .speak(speechText)
            .reprompt(speechText)
            .withSimpleCard('How about this?', speechText)
            .addVideoAppLaunchDirective(video.source, video.metadata.title, video.metadata.subtitle)
            .getResponse();
    },
};

module.exports = TrickTeachingIntent;